package com.heima.admin.controller.v1;

import com.heima.apis.wemedia.IWeMediaClient;
import com.heima.model.admin.dtos.NewsAuthDto;
import com.heima.model.common.dtos.ResponseResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/api/v1/news")
public class AdCheckController {
    @Autowired
    private IWeMediaClient weMediaClient;

    //查询审核列表
    @PostMapping("/list_vo")
    public ResponseResult wmCheckPageList(@RequestBody NewsAuthDto newsAuthDto) {
        return weMediaClient.wmCheckPageList(newsAuthDto);
    }

    //查询文章详情
    @GetMapping("/one_vo/{id}")
    public ResponseResult detail(@PathVariable Integer id) {
        return weMediaClient.detail(id);
    }

    //审核失败
    @PostMapping("/auth_fail")
    public ResponseResult checkFail(@RequestBody NewsAuthDto newsAuthDto) {
        return weMediaClient.checkFail(newsAuthDto);
    }

    //人工审核通过
    @PostMapping("/auth_pass")
    public ResponseResult checkPass(@RequestBody NewsAuthDto newsAuthDto) {
        return weMediaClient.checkPass(newsAuthDto);
    }
}


